﻿namespace PugLib.UnitTest
{
	using Microsoft.VisualStudio.TestTools.UnitTesting;

	using PugLib.Collections;

	/// <summary>
	///This is a test class for BidirectionalDictionaryTest and is intended
	///to contain all BidirectionalDictionaryTest Unit Tests
	///</summary>
	[TestClass]
	public class BidirectionalDictionaryTest
	{
		/// <summary>
		///A test for BidirectionalDictionary`1 Constructor
		///</summary>
		public void BidirectionalDictionaryConstructorTestHelper()
		{
			BidirectionalDictionary<string> seng = new BidirectionalDictionary<string>();

			seng.Add("0", "0");
			Assert.AreEqual(seng["0"], "0");

			seng.Add("01", "0101");
			Assert.AreEqual(seng["01"], "0101");
			Assert.AreEqual(seng["0101"], "01");

			seng.Add("1", "11");
			Assert.AreEqual(seng["1"], "11");
			Assert.AreEqual(seng["11"], "1");

			seng.Remove("11");
			Assert.IsFalse(seng.ContainsKey("1"));

			seng.Remove("1");
			Assert.IsFalse(seng.ContainsKey("11"));

			seng.Remove("0101");
			Assert.IsFalse(seng.ContainsKey("01"));
		}


		[TestMethod]
		[DeploymentItem("PugLib.dll")]
		public void BidirectionalDictionaryConstructorTest()
		{
			BidirectionalDictionaryConstructorTestHelper();
		}
	}
}